<template>
  <div class="Homechir">
    <div class="content">
    <!--    物流信息-->
      <p style="width: 100%;color: #242526;font-size: 22px;font-weight:500;padding:5px 0 0 25px;text-align: center;line-height: 45px;margin:0;border-bottom:1px dashed #999;">订单详情 </p>
      <div style="width:100%;height:40px;background-image: linear-gradient(to right, #07a6a5 , #fff);">
          <p style="padding-left:20px;line-height:40px;font-size:20px;margin:5px 0 0;color:#fff">订单信息</p>
      </div>
    <!--  订单信息  -->
      <div class="Homechir-one" style="padding: 10px 0;">
        <div style="width: 380px;float: left;">
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">订单号: {{ count.orderNumber ? count.orderNumber : '暂无订单号' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">收货人: {{ count.receiverName ? count.receiverName : '暂无收货人' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">联系电话: {{ count.receiverPhone ? count.receiverPhone : '暂无联系电话' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">收货地址: {{ count.detailAddress ? count.detailAddress : '暂无收货地址'}}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">支付方式: {{ count.tradingChannels === 0 ? '微信支付' : (count.tradingChannels === 1 ? '支付宝支付' : '线下支付') }}</p>
  <!--        <p style="width: 350px;margin: auto;color: #F56C6C;font-size: 21px;height: 35px;line-height: 35px">{{ distributionStatus === 6 ? '待配送' : (distributionStatus === 7 ? '待收货' : (distributionStatus === 8 ? '已完成' : (distributionStatus === 10 ? '待退款' : '已退款'))) }}</p>-->
  <!--        <p style="width: 350px;margin: auto;color: #888888;font-size: 13px;line-height: 15px;height: 15px">{{ distributionStatus === 6 ? '客户已付款,等待商家发货' : (distributionStatus === 7 ? '调配药师已审核发药,等待客户确认收货' : (distributionStatus === 8 ? '客户已确认收货,订单完成' : (distributionStatus === 10 ? '订单待退款' : '订单已退款'))) }}</p>-->
        </div>
        <div style="width: calc(100% - 380px);float: left;height: 78px;margin-top: 65px;padding: 0 20px;border-left: 1px solid #E4E9EE;height: 140px;margin-top: 10px;">
          <p style="float: left;margin: auto;color: #F56C6C;font-size: 21px;height: 35px;line-height: 35px">{{count.distributionStatus | capitalize }}</p>
          <!-- <div style="float: right;">
            <p style="margin:0;margin-left: 20px;color: #242526;font-size: 13px;height: 30px;">承运人: {{count.expressName ? count.expressName : '暂无承运人'}}</p>
            <p style="margin:0;margin-left: 20px;color: #242526;font-size: 13px;height: 30px;">运单号: {{count.expressCode ? count.expressCode : '暂无运单号'}}</p>
            <Button type="primary" v-if="count.expressCode" style="font-size: 14px;border-radius:10px;line-height: 20px;float:right;" @click="cahidwhawuliu(count.expressCode)">运单详情</Button>
            <Button disabled v-if="!count.expressCode" style="font-size: 14px;border-radius:10px;line-height: 20px;float:right;">暂无运单详情</Button>
          </div> -->
          <div class="time" style="width:100%;margin:0 auto 10px;padding-top: 10px;float: left;">
              <span style="width:23%;display:inline-block;text-align:left">{{count.doctorTime?count.doctorTime:''}}</span>
              <span style="width:22%;display:inline-block;text-align:left">{{count.ysshTime?count.ysshTime:''}}</span>
              <span style="width:23%;display:inline-block;text-align:left">{{count.createTime?count.createTime:''}}</span>
              <span style="width:21%;display:inline-block;text-align:left;">{{count.doctorFyTime?count.doctorFyTime:''}}</span>
              <span style="display:inline-block;text-align:left">{{count.endTime?count.endTime:''}}</span>
            </div>
          <!-- <Steps v-if="status === -1" :current="distributionStatus === 6 ? 0 : (distributionStatus === 7 ? 1 : 2)"> -->
          <Steps v-if="status === -1" :current="distrcode === 4 ? 0 : ( distrcode === 13 ? 1 : (distrcode === 5 || distrcode === 6 || distrcode === 7 || distrcode === 13 ? 3 : 4))" align-center process-status="wait">
            <Step title="医生开具处方" :content="count.doctorName?count.doctorName:''" style="width: auto" icon="ios-checkmark"></Step>
            <Step title="药剂师审方" :content="count.ysshName?count.ysshName:''" style="width: auto" icon="ios-checkmark"></Step>             
            <Step style="width: auto" title="药店接收订单" icon="ios-checkmark"></Step>
            <Step v-if="distributionStatus === 10" style="width: auto" title="药店待退款" :icon="distributionStatus !== 10 ? 'ios-checkmark' : 'ios-close'"></Step>
            <Step v-else style="width: auto" title="调配师审药发药" :icon="distributionStatus !== 6 ? 'ios-checkmark' : 'ios-close'"></Step>
            <Step v-if="distributionStatus === 11" style="width: auto" title="药店退款" icon="ios-checkmark"></Step>
            <Step v-else title="用户取药" style="width: auto" :icon="distributionStatus === 8 ? 'ios-checkmark' : 'ios-close'"></Step>
          </Steps>
          <Steps v-else :current="distributionStatus === 6 ? 1 : (distributionStatus === 7 ? 2 : (distributionStatus === 8 ? 3 : (distributionStatus === 11 ? 2 : 1)))" align-center process-status="wait">
            <Step style="width: auto" title="药店接收二审处方" icon="ios-checkmark"></Step>
            <Step v-if="status === 1" style="width: auto" title="处方二审成功" icon="ios-checkmark"></Step>
            <Step v-else style="width: auto" title="处方二审驳回" icon="ios-close"></Step>
            <Step v-if="distributionStatus === 10 || distributionStatus === 11" style="width: auto" title="药店退款" :icon="distributionStatus === 11 ? 'ios-checkmark' : 'ios-close'"></Step>
            <Step v-if="distributionStatus === 6 || distributionStatus === 7 || distributionStatus === 8" style="width: auto" title="调配药师审药发药" :icon="distributionStatus === 7 || distributionStatus === 8 ? 'ios-checkmark' : 'ios-close'"></Step>
            <Step v-if="distributionStatus === 6 || distributionStatus === 7 || distributionStatus === 8" style="width: auto" title="客户确认收货" :icon="distributionStatus === 8 ? 'ios-checkmark' : 'ios-close'"></Step>
          </Steps>
        </div>
      </div>
      <!--  处方驳回信息  -->
      <div v-show="status === 0 && count.createTime" class="Homechir-sel" style="padding-top: 10px;">
        <div style="width: 380px;height: 180px;float: left;border-right: 1px solid #E4E9EE;">
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 16px;line-height: 30px;height: 30px;margin-top: 10px">处方驳回信息</p>
          <p style="width: 350px;margin:0;margin-top: 10px;margin-left: 20px;color: #242526;font-size: 13px;line-height: 22px;height: 22px;">驳回原因: {{ count.rejectReason === '1' ? '处方不合规' : (count.rejectReason === '2' ? '用药不适宜' : '超长处方') }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">驳回时间: {{ count.createTime ? count.createTime : '暂无驳回时间' }}</p>
        </div>
        <div style="width: calc(100% - 380px);float: left;">
          <p style="width: 90%;margin: 0 auto 0 auto;color: #242526;font-size: 14px;line-height: 25px;min-height: 60px;margin-top: 50px">驳回原因详细说明：{{ count.reportType ? count.reportType : '暂无驳回原型详细说明' }}</p>
        </div>
      </div>
      <!--  退款信息  -->
      <div v-show="distributionStatus === 10 || distributionStatus === 11" class="Homechir-sel" style="padding-top: 10px;height: 225px">
        <div style="width: 380px;height: 205px;float: left;border-right: 1px solid #E4E9EE;">
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 16px;line-height: 30px;height: 30px;margin-top: 10px">退款信息</p>
          <p style="width: 350px;margin:0;margin-top: 10px;margin-left: 20px;color: #242526;font-size: 13px;line-height: 22px;height: 22px;">订单编号: {{ count.orderNumber ? count.orderNumber : '暂无订单编号' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">退款金额: {{ count.drugMoney ? count.drugMoney : 0 }}元</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">订单总金额: {{ count.drugMoney ? count.drugMoney : 0 }}元</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">退款路径: 原路返回</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">退款时间: {{ count.refundTime ? count.refundTime : '暂无退款时间' }}</p>
        </div>
        <div style="width: calc(100% - 380px);float: left;">
          <p style="width: 90%;margin: 0 auto 0 auto;color: #242526;font-size: 14px;line-height: 25px;min-height: 60px;margin-top: 50px">退款原因：{{ count.reason ? count.reason : '暂无退款原因' }}</p>
        </div>
      </div>
      <!--  物流信息  -->
      <div v-show="count.expressCode && count.expressName" style="width:100%;height:40px;background-image: linear-gradient(to right, #07a6a5 , #fff);">
        <p style="padding-left:20px;line-height:40px;font-size:20px;margin:5px 0 0;color:#fff">物流信息</p>
      </div>
      <div v-show="count.expressCode && count.expressName" class="Homechir-two" style="min-height: 100px;">
        <div style="width: 380px;float: left;border-right: 1px solid #E4E9EE;height: 80px;margin-top: 10px;">
          <!-- <p style="width: 350px;margin:0 auto;color: #242526;font-size: 16px;margin-top: 15px;height: 35px;line-height: 35px;">物流信息</p> -->
          <p style="width: 350px;margin:0 auto;color: #242526;font-size: 13px;height: 30px;line-height: 30px;">配送方式: {{distributionType}}</p>
          <p style="width: 350px;margin:0 auto;color: #242526;font-size: 13px;line-height: 25px;height: 25px;">物流公司: <span style="color: #409EFF">{{ count.expressName ? count.expressName + '快递' : '立即发货' }}</span></p>
          <p style="width: 350px;margin:0 auto;color: #242526;font-size: 13px;line-height: 25px;height: 25px;">物流单号: <span style="color: #242526">{{ count.expressCode ? count.expressCode : '---' }}</span></p>
        </div>
        <div style="width: calc(100% - 400px);float: left;min-height: 80px;margin-top: 10px;margin-left: 10px;">
            <div style="width: 150px;float: left;text-align: center;line-height:78px">
              <i-button type="primary" style="display: block;width: 95px;height: 35px;line-height: 0;" @click="cahidwhawuliu(count.expressCode)">查看物流</i-button>
            </div>
            <div v-show="wuliumask" style="width: 200px;margin: auto;float: left;height: 78px;line-height:78px;"><img src="@/assets/basic1.png" alt="" style="display: block;width: 40px;height: 40px;float: left;margin-top: 19px;"><span style="display: block;width: 150px;font-size: 14px;float: left;color: #888888">暂无相关的物流信息</span></div>
            <!-- <div v-show="!wuliumask" class="wuliu" style="width: calc(100% - 150px);min-height: 80px;float: left;overflow: auto">
              <Steps direction="vertical" :current="1">
                <Step v-for="item in wulist" :key="item.opcode" :title="item.acceptTime" :content = "item.remark" icon="iconfont icon-yuan"></Step>
              </Steps>
            </div> -->
        </div>
      </div>
      <!--  处方明细  -->
      <div style="width:100%;height:40px;background-image: linear-gradient(to right, #07a6a5 , #fff);">
        <p style="padding-left:20px;line-height:40px;font-size:20px;margin:5px 0 0;color:#fff">处方明细</p>
      </div>
      <div class="Homechir-sel" style="padding-top: 10px;min-height: 160px;margin-bottom: 20px">
        <div style="width: 380px;min-height: 150px;float: left;border-right: 1px solid #E4E9EE;">
          <Button type="primary" style="font-size: 13px;border-radius:10px;line-height: 10px;float:right;margin-right:10px" @click="search(count.clinicId)">查看处方笺</Button>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">处方编号: {{ count.rxId ? count.rxId : '暂无订单号' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;text-overflow: ellipsis;
                white-space: nowrap;overflow: hidden;" :title="count.assessmentcontent? count.assessmentcontent : '诊断结果' ">诊断结果:&nbsp;&nbsp;{{count.assessmentcontent? count.assessmentcontent : '诊断结果' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">订单药品金额: &nbsp;&nbsp;{{ count.amt }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">订单配送金额: &nbsp;&nbsp;{{ count.distributionFee ? count.distributionFee : '0' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">订单支付总金额: &nbsp;&nbsp;{{ count.drugMoney ? count.drugMoney : '0' }}</p>
        </div>
        <div style="width: calc(100% - 380px);float: left;">
            <!-- <p style="width: 90%;margin: 0 auto 0 auto;color: #242526;font-size: 16px;line-height: 30px;height: 30px;margin-top: 10px">药品清单</p> -->
            <div style="width: 90%;margin: 0 auto 0 auto;text-align: center">
              <Table
                :columns="columns1"
                :data="data2"
                border
                style="width: 100%;text-align: center;margin-top:10px"
                :header-cell-style="{background:'#FAFAFA',color:'#242526',border: '1px solid #E8E8E8 !important','text-align': 'center',height: '30px !important', padding: '8px 0'}"
                :cell-style="{background:'#ffffff',color:'#242526',border: '1px solid #E8E8E8 !important','text-align': 'center',height: '30px !important', padding: '8px 0'}"
              ></Table>
            </div>
          </div>
          <div style="clear: both"></div>
      </div>
      <!--  订单信息  -->
      <!-- <div class="Homechir-sel" style="padding-top: 10px;height: 300px">
        <div style="width: 380px;height: 280px;float: left;border-right: 1px solid #E4E9EE;">
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 16px;line-height: 30px;height: 30px;margin-top: 10px">订单信息</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">订单配送类型: 物流配送</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">收货人: {{ count.receiverName ? count.receiverName : '暂无收货人' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">联系电话: {{ count.receiverPhone ? count.receiverPhone : '暂无联系电话' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">收货地址: {{ count.detailAddress ? count.detailAddress : '暂无收货地址' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">订单号: {{ count.orderNumber ? count.orderNumber : '暂无订单号' }}</p>
          <p style="width: 350px;margin:0;margin-left: 20px;color: #242526;font-size: 13px;line-height: 30px;height: 30px;">支付方式: 微信支付</p>
        </div>
        <div style="width: calc(100% - 380px);float: left;">
          <p style="width: 90%;margin: 0 auto 0 auto;color: #242526;font-size: 16px;line-height: 30px;height: 30px;margin-top: 10px">药品清单</p>
          <div style="width: 90%;margin: 0 auto 0 auto;text-align: center">
            <Table
              :columns="columns1"
              :data="data2"
              height="200"
              border
              style="width: 100%;text-align: center"
              :header-cell-style="{background:'#FAFAFA',color:'#242526',border: '1px solid #E8E8E8 !important','text-align': 'center',height: '30px !important', padding: '8px 0'}"
              :cell-style="{background:'#ffffff',color:'#242526',border: '1px solid #E8E8E8 !important','text-align': 'center',height: '30px !important', padding: '8px 0'}"
            ></Table>
          </div>
          <p style="text-align: right;width: 90%;margin: 0 auto 0 auto;color: #242526;font-size: 12px;height: 30px;line-height: 30px">订单药品金额：<span>￥{{ count.amt }}</span><span style="display: inline-block;margin-left: 20px;">订单配送费：<span>￥{{ count.provice ? count.provice : '0' }}</span></span><span style="display: inline-block;color: #FD5C72;margin-left: 20px;">支付总金额：<span>￥{{ count.drugMoney ? count.drugMoney : '0' }}</span></span></p>
        </div>
      </div> -->
      <div style="">
        <Button size="small" style="display: block;width: 100px;height: 40px;line-height: 0;margin: 25px auto;" @click="handleitemback">
          <i class = "iconfont icon-butongyi" style="font-size:14px;margin-right:5px"></i>返回
        </Button>
      </div>
      <Modal
        v-model="fundcode"
        title="订单详情"
        :footer="null"
        styles="padding: none;margin: none"
        >  	
        <div style="margin: -16px;padding: 10px 0;width:100%">
            <div style="width:100%;height:40px;background-image: linear-gradient(to right, #07a6a5 , #fff);">
              <p style="padding-left:25px;line-height:40px;font-size:16px;color:#fff">承运人：顺丰快递 <span style="padding-left:20px;color:#fff">运单号：</span> {{count.expressCode}}</p>
            </div>
            <!-- <div v-show="!count.expressCode" style="width: 200px;margin: auto;height: 78px;line-height:78px;">
              <img src="@/assets/basic1.png" alt="" style="display: block;width: 40px;height: 40px;margin-top: 65px;">
              <span style="display: block;font-size: 14px;color: #888888">暂无相关的物流信息</span>
            </div> -->
            <div class="wuliu" style="margin-top: 10px;padding-left:25px;width:100%">
              <Steps direction="vertical"  process-status="wait" :current = '1' style="display:flex;flex-direction:column">
                <Step v-for="item in wulist" :key="item.opcode" :title="item.acceptTime" :content = "item.remark" icon="ios-checkmark" ></Step>
              </Steps>
            </div>
        </div>
        <div slot="footer" style="text-align:center">
          <Button @click="fundcode = false">
            <i class = "iconfont icon-butongyi" style="font-size:14px;margin-right:5px"></i>取消
          </Button>		
        </div>			
      </Modal>
      <Modal
          v-model="madecode"
          title="电子处方"
          :footer="null"
          styles="padding: none;margin: none"
          >  	
          <div class="PerMask">
            <div class="PerMask-com">
              <div class="com-right" :style="codes">
                    <div class="header">  
                        <p>{{clinic.hospitalName}}</p>            
                        <p>电子处方笺</p>
                        <p>普通药品处方</p>
                        <img v-if="!clinic.twoDimensionCode" src="../../../../assets/images/ele-code.png" alt="">
                        <img v-if="clinic.twoDimensionCode" :src="clinic.twoDimensionCode" alt="">
                        <div class="nub">
                            <span style="float:left"><b>门诊号</b>&nbsp;:&nbsp;{{clinic.clinicNumber}}</span>
                            <span style="float:right"><b>处方号</b>&nbsp;:&nbsp;{{clinic.rxNumber}}</span>    
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="essential">
                        <span>姓名&nbsp;:&nbsp;<small>{{clinic.name}}</small></span>
                        <span>性别&nbsp;:&nbsp;<small>{{clinic.gender === 1 ? '男':clinic.gender ===2?'女':'其他'}}</small></span>
                        <span>年龄&nbsp;:&nbsp;<small>{{clinic.age}}岁</small></span>
                        <span>联系电话&nbsp;:&nbsp;<small>{{clinic.telephone}}</small></span>
                        <span>身份证号&nbsp;:&nbsp;<small>{{clinic.idcard}}</small></span>
                        <span>开单科室&nbsp;:&nbsp;<small>{{clinic.doctorDeptName}}</small></span>
                        <span>开单医生&nbsp;:&nbsp;<small>{{clinic.doctorName}}</small></span>
                        <span>费别&nbsp;:&nbsp;<small>{{ clinic.paytype==1?'城镇职工基本医疗保险':clinic.paytype==2?'新型农村合作医疗':clinic.paytype==3?'城镇居民基本医疗保险':clinic.paytype==4?'离休干部医疗保险':'自费' }}</small></span>
                        <span v-if="clinic.address">地址&nbsp;:&nbsp;<small>{{clinic.address}}</small></span>
                    </div>
                    <div class="result">
                        <p class="title">诊断结果</p>
                        <div class="text dhei">
                            {{ clinic.assessmentcontent ? clinic.assessmentcontent : '暂无' }}
                        </div>
                        <p class="title">RP</p>
                        <div v-for="(rps,index) in rpList" :key="rps.id">
                            <span style="font-size:16px">{{index+1}}.</span>
                            <p class="tt" style="margin:5px 0">{{rps.itemname}}&nbsp;{{rps.itemspec}}&nbsp;X{{rps.itemdose}}{{rps.itemdoseunit}}</p>               
                            <!-- <p class="nub">用法用量&nbsp;:&nbsp;&nbsp;{{rps.itemspec}}/{{rps.itemroute}}&nbsp;{{rps.itemsingledose}}日{{rps.itemsingledoseunit}}/&nbsp;&nbsp;{{rps.itemfrequency}}</p> -->
                            <p class="nub">用法用量&nbsp;:&nbsp;&nbsp;{{rps.itemroute}}&nbsp;{{rps.itemsingledose}}{{rps.itemsingledoseunit}}/次&nbsp;&nbsp;{{rps.itemfrequency}}</p>
                            <p class="nub">备注&nbsp;:&nbsp;&nbsp;{{rps.medicalAdvice || '无'}}</p>
                            <img src="../../../../assets/images/zhang.png" alt="">
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="physician">
                        <span v-if="!clinic.prescriptionSignature">处方医师&nbsp;:&nbsp;<small>{{ clinic.doctorName}}</small></span>
                        <span v-if="clinic.prescriptionSignature">处方医师&nbsp;:&nbsp;<img  :src="clinic.prescriptionSignature" /></span>
                        <span v-if="!clinic.prescriptionReview">处方审核&nbsp;:&nbsp;<small >{{ clinic.qdDocname}}</small></span>
                        <span v-if="clinic.prescriptionReview">处方审核&nbsp;:&nbsp;<img :src="clinic.prescriptionReview" /></span>
                        <span >药品调配&nbsp;:&nbsp;<small >{{clinic.medicineName}}</small></span>
                        <!-- <span>药品调配&nbsp;:&nbsp;<img v-if="tab==1||tab==6" :src="clinic.prescriptionReview" /></span> -->
                        <span>电子处方时间&nbsp;:&nbsp;<small>{{clinic.createtime}}</small></span>
                    </div>
                </div>
              
            </div>
          </div>

          <div slot="footer" style="text-align:center">
            <Button @click="madecode = false">
              <i class = "iconfont icon-butongyi" style="font-size:14px;margin-right:5px"></i>取消
            </Button>		
          </div>		
        </Modal>
    </div>
  </div>
</template>

<script>
import api from "@/api/commonApi";
export default {
  name: 'Phachir',
  data() {
    return {
      columns1: [
        { title: "药品编码", key: "id", align: "center"},
        { title: "药品通用名", key: "itemname", align: "center"},
        { title: "规格", key: "itemspec", align: "center"},
        { title: "剂型", key: "ypjx", align: "center"},
        { title: "单位", key: "itemdoseunit", align: "center"},
        { title: "数量", key: "itemdose", align: "center"},
        { title: "库存", key: "stock", align: "center"},
        { title: "售价", key: "price", align: "center"}
      ],
      wuliumask: false,
      distributionStatus: null,
      distributionType: null,
      status: null,
      data2: [],
      count: {},
      fundcode: false,
      madecode: false,
      clinic: {},
      rpList: {},
      wulist: {}
    }
  },
  created() {
    let breadList = [
      { path: "/index", title: "首页" },
      {
        path: "",
        title: "处方管理"
      },
      {
        path: "operation/prescriptionmanage/ordersearch/review",
        title: "订单详情"
      }
    ];
    this.$emit("changeBreadList", breadList);
  },
  mounted() {
    this.ishomeget()
  },
  filters: {
    capitalize(val) {
      console.log(val)
      switch (val) {
        case 4:
          return '待支付';
        case 5:
          return '待取药';
        case 6:
          return '待配送';
        case 7:
          return '待收货';
        case 8:
          return '已完成';
        case 10:
          return '无效处方';
        case 11:
          return '已退费';
        default:
          return '超时未支付';
      }
    }
  },
  methods: {
    ishomeget() {
      const map = {
        id: this.$route.params.id
      }
      console.log(map)
      this.$axios
        .post(api.ordersSearchDetail, map)
        .then(res => {
          if (res.data.code === 1) {
            this.count = res.data.object;
            this.status = parseInt(res.data.object.status)
            this.distributionStatus = parseInt(res.data.object.distributionStatus)
            this.distributionType = parseInt(res.data.object.distributionType)
            if(this.distributionType == 0){
              this.distributionType = '快递配送'
            }
            if(this.distributionType == 1){
              this.distributionType = '药店配送'
            }
            
            this.data2 = res.data.object.clinicBillEntityList
          } else {
            this.$Message.error("请求异常");
          }
        })
    },
    //查询物流信息
    cahidwhawuliu(counts) {
      this.fundcode = true
      const map = {
        expNo: counts
      }
      this.$axios
        .post(api.findOrderTracesByexpNo, map)
        .then(res => {
          if (res.data.code === 1) {
            // var andlist = JSON.parse(res.message)
            var andlist = res.data.object
            andlist.sort((a, b) => a.opcode > b.opcode ? -1 : 1)
            this.wulist = andlist
            this.wuliumask = false
          } else {
            this.$Message.error(res.data.message || "请求异常");
          }
        })
    },
    //电子处方详情
    search(clinicId){   
        this.madecode = true
        const map = {
          clinicId:clinicId
        }
        this.$axios
        .post(api.findClinicPrescriptions, map)
        .then(res => {  
          console.log(clinicId)       
          if (res.data.code === 1) {
              this.clinic = res.data.object;
              this.rpList = res.data.object.rpList
              if(this.clinic.prescriptionSignature){this.clinic.prescriptionSignature = this.fileBaseUrl + JSON.parse(res.data.object.prescriptionSignature).smallFileName}
              if(this.clinic.prescriptionReview){this.clinic.prescriptionReview = this.fileBaseUrl + JSON.parse(res.data.object.prescriptionReview).smallFileName}
              if(this.clinic.twoDimensionCode){this.clinic.twoDimensionCode = this.fileBaseUrl + JSON.parse(res.data.object.twoDimensionCode).smallFileName}
          } else {
            this.$Message.error(res.data.message || "请求异常");
          }
        })
    },
    handleitemback() {
      this.$router.back()
    }
  }
}
</script>

<style lang="less" scoped>
  .ivu-steps {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    width: 100%;
    font-size: 0;
    line-height: 1.5;
  }
  .ivu-steps-item:last-child{
    flex: none !important;
  }
  .Homechir .ivu-steps-item{
    display: inline-block;
    position: relative;
    vertical-align: top;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    overflow: hidden;
  }
  .Homechir {
    width: 100%;
    min-width: 1000px;
    padding-bottom: 25px;
    .content{
      width: calc(100% - 20px);
      margin: auto;
      background-color: #fff;
      padding-bottom: 15px;
    }
    .Homechir-one,
    .Homechir-two,
    .Homechir-sel{
      width: calc(100% - 20px);
      margin: auto;
      // margin-top: 25px;
      min-height: 180px;
      background-color: white;
      // box-shadow:0px 0px 15px 0px rgba(127,127,127,0.1);
      // border-radius:10px;
    }
  }
  .PerMask{
      width: 100%;
      height: 100%;
      padding: 0;
      margin: 0;
      .PerMask-com{
        padding-bottom: 30px;
        background-size:cover;
        position: relative;
        top:0;
        left:0;           
        overflow: scroll;
        background-image: url('../../../../assets/images/report_bg.jpg');
          .com-right{
            height: calc(100% - 40px);
            font-size: 14px;
            color: #242526;
            .com-left-one{
              width: 100%;
              height: calc(100% - 110px);
              overflow: auto;
            }
            .com-left-two{
              width: 100%;
              height: calc(100% - 81px);
              overflow: auto;
            }
            .com-left-one::-webkit-scrollbar,
            .com-left-two::-webkit-scrollbar{
              height: 0;
              width: 0;
            }
            .physician{
              width: 100%;
              min-height: 10px;
              margin-left: 5px;
              padding-top: 5px;
              span{
                display: inline-block;
                min-width: 32%;
                color: #999;
                font-size: 14px;
                line-height: 25px;
                display: inline-block;
                text-align: left;
                margin-bottom:5px;
                small{
                    font-size: 12px;
                    color: #333;
                    font-weight: 500;
                }
                img{
                    width: 80px;
                    height: 50px;
                    vertical-align: middle;
                }
              }
            }
            .line{
              width: 97%;
              height: 10px;
              margin-left: 5px;
              border-top:2px solid #333333;
              border-bottom:2px solid #333333;
            }
            .header{
              width: 100%;
              min-height: 100px;
              padding: 10px;
              text-align: center;
              position: relative;
              p:nth-child(1){
                font-size:20px;
                color: #333;
                font-weight: 500;
                margin: 10px 0;
              }
              p:nth-child(2){
                font-size:22px;
                color: #333;
                margin: 10px 0;
                font-weight: 500;
              }
              p:nth-child(3){
                border: 1px solid #999;
                width: 70px;
                height: auto;
                line-height: 26px;
                color: #333;
                font-size: 20px;
                position: absolute;
                top: 15px;
                left: 15px;
              }
              img{
                width: 80px;
                height: 80px;
                position: absolute;
                top: 10px;
                right: 15px;
              }
              .nub{
                padding: 15px 0 20px 0;
                span{
                    color: #333;
                    font-size: 15px;
                    b{
                        color: #999;
                        font-size: 13px;
                    }
                }
              }
            }
              
            }
          }
          .result{
            width: 98%;
            min-height: 160px;
            max-height: 300px;
            overflow-y: scroll;
            margin-left: 5px;
            position: relative;
            .title{
                color: #999;
                font-size: 14px;
                margin: 8px 0;
            }
            .dhei{
                border-bottom:1px dashed #cccccc;
            }
            .text{
                color: #333;
                font-size: 16px;
                font-weight: 500;
                line-height: 26px;
                letter-spacing: 1px;
            }
            .tt{
              display: inline-block;
                color: #333;
                font-size: 18px;
                font-weight: 500;
                letter-spacing: 1px;
            }
            .nub{
                    font-size: 16px;
                    color: #999;
                    margin: 5px 0;
            }
            img{
                width: 80px;
                height: 80px;
                position: absolute;
                bottom: 25px;
                right: 10px;
            }
        }
        .essential{
          width: 98%;
          min-height: 100px;
          margin-left: 8px;
          padding: 7px 0;
          border-bottom:1.5px solid #cccccc;
          box-sizing: border-box;
          span{
              color: #999;
              font-size: 14px;
              line-height: 25px;
              display: inline-block;
              text-align: left;
              small{
                color: #333;
                font-size: 14px;
                font-weight: 500;
              }
          }
          span:nth-child(1){
            margin-right: 150px;
          }
          span:nth-child(2){
            margin-right: 80px;
          }
          span:nth-child(4){
            margin-right: 45px;
          }
          span:nth-child(6){
            margin-right: 65px;
          }
          span:nth-child(7){
            margin-right: 65px;
          }
          span:nth-child(8){
            margin-right: 25px;
          }
        }
      }
</style>
